%
option explicit
on error resume next
%>
<%
dim oConn
set oConn = server.createobject("adodb.connection")
oConn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("/db/kcrhca.mdb") & ";"
%>
<%
dim sFrom
dim sId
dim oRS
dim aRS
dim sql
dim sDate, sTitle, sBody, sLocation, sTime
dim sqDate, sqNextDate
sId = request.querystring("id")
sFrom = request.querystring("from")
sql = "SELECT id, [date], title, body, location, [time] FROM calendar WHERE id = " & sId
oConn.errors.clear()
set oRS = oConn.execute(sql)
if oConn.errors.count > 0 then
response.write "SQL error: " & oConn.errors(0).description & "
" & sql
response.end
end if
if oRS.eof then
bNothing = true
else
aRS = oRS.getrows()
end if
set oRS = nothing
sDate = aRS(1,0)
sTitle = aRS(2,0)
sBody = aRS(3,0)
sLocation = aRS(4,0)
sTime = aRS(5,0)
sTime = formatdatetime(sTime,3)
sTime = replace(sTime, ":00 ", " ")
if sTime = "12:00 AM" then
sTime = ""
end if
sBody = replace(sBody, chr(10), " ")
%>